package org.qqcui.designpattern.patterns.flyweight;

/**
 * 享元模式客户端
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/1 9:26
 **/
public class Client {

    public static void main(String[] args) {
        WebsiteFactory factory = new WebsiteFactory();
        Website website1 = factory.getWebsiteCatagory("新闻");
        website1.use(new User("Tom"));

        Website website2 = factory.getWebsiteCatagory("博客");
        website2.use(new User("Jack"));

        Website website3 = factory.getWebsiteCatagory("博客");
        website3.use(new User("Kim"));

        System.out.println(factory.getWebsiteCount());
    }
}
